/*******************************************
* HistoryList is the list recording the sequence of operations.
* It's used for Undo/Redo function
* The basic structure is implemented by Deque (Double-Queue)
******/
class HistoryList : private Deque<Command*>
{
public:
	HistoryList();
	void Record(Command* objCommand);
	bool IsEmpty() const
		{return Deque<Command*>::IsEmpty();}
	void Undo();
	void Redo();
	bool NoUndo(){return isMostPrevious;}
	bool NoRedo(){return isMostEnd;}
	void Clear()
	{		
		Deque<Command*>::Clear();
		isMostPrevious = true;
		isMostEnd = true;
		pCurrent = pRear;
	}
protected:
	void Cut(DoubleLinkedNode<Command*>* pCutPost);
	DoubleLinkedNode<Command*>* pCurrent;
	bool isMostPrevious;
	bool isMostEnd;
};
